﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace parkingclient
{
    public partial class res_delete : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //if user is not an admin, redirect to main page
            if (Session["userType"] == null || int.Parse(Session["userType"].ToString()) != 3)
            {
                Response.Redirect("Default.aspx");
            }

            //cancel the reservation
            string resid = Request.QueryString["resid"];

            ParkingService.WebService1 parking = new ParkingService.WebService1();
            parking.cancelReservation(Int32.Parse(resid));

            //redirect back to the reservation management page
            Response.Redirect("admin_res.aspx");

        }
    }
}